<?php
namespace App\Services\User;

use App\Models\Star;

class GetStareCountService {

    public static function handle($user_id, $type = null) {
        return Star::when($type, function ($q) use($type) {
            $q->where('type', $type);
        })->where('user_id', $user_id)->count();
    }
}